package com.woniu.woniuproject.service;

import com.woniu.woniuproject.entity.Admin;
import com.woniu.woniuproject.mapper.AdminMapper;
import com.woniu.woniuproject.vo.ARmiddle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 功能描述:<br>
 * 〈〉
 *
 * @author EDZ
 * @create 2020/11/16
 * @since 1.0.0
 */
@Service
public class AdminService {
    @Autowired
    AdminMapper adminMapper;

    public Admin queryAdminByName(String name) {

        return adminMapper.selectAdminByName(name);
    }

    public Integer updateAdminByPass(String adminname, String pass) {
        return adminMapper.updateAdminByPass(adminname,pass);
    }

    public List<ARmiddle> queryAdmin(String name, String role) {
        return adminMapper.selectAdmin(name,role);
    }

    public int UpdatedeleteAdminbyId(int rows, Date date) {
        return adminMapper.UpdatedeleteAdminbyId(rows,date);
    }

    public int UpdateaddAdminbyId(int rows) {
        return adminMapper.UpdateaddAdminbyId(rows);
    }

    public int addAdmin(String adminname, String password,String phone) {
        return adminMapper.addAdmin(adminname,password,phone);
    }

    public int updatearminddle(int aId) {
        return adminMapper.updatearminddle(aId);
    }

    public Admin queryAdminByPhone(String phone) {
        return adminMapper.selectAdminByPhone(phone);
    }

    public int updateAdminPass(String newpass, String phone) {
        return adminMapper.updateAdminPass(newpass,phone);
    }
}
